package com.tungse.study.chat;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class ClientReadChat {

    public static void main(String[] args) throws IOException {

        Socket socket = new Socket("127.0.0.1", 9999);


        while (true) {
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            String msg = bufferedReader.readLine();
            System.out.println(msg);

        }

    }
}
